﻿Imports System.Web
Imports System.Web.Services

Public Class SMSHandler
    Implements System.Web.IHttpHandler

    Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest


        Dim u = context.Request("u")
        Dim p = context.Request("p")
        Dim m = context.Request("m")
        Dim n = context.Request("n")
        Dim t = context.Request("t")

        t = 2

        Dim obj As ISmsSender
        Select Case t
            Case 1
                obj = New SendSMSFullOnSMS
            Case 2
                obj = New Way2SMS
            Case Else
                obj = New Way2SMS 'New SendSMSFullOnSMS
        End Select

        'Dim obj As New Way2SMS
        Dim res = obj.SendSMS(u, p, m, n)

        context.Response.ContentType = "text/html"

        context.Response.Write(res.Status)

    End Sub

    ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
        Get
            Return False
        End Get
    End Property

End Class